<template>
  <div class="multipleUploadImg">
    <div class="img-wrapper">
      <ul class="imgs-list">
        <li v-for="item in imgs">
          <img :src="item" alt="">
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'multipleImgView',
    data () {
      return {
        imgs: []
      }
    },
    props: ['value'],
    watch: {
      value() {
        if (this.value) {
          this.imgs = this.value.split(',')
        } else {
          this.imgs = []
        }
      }
    }
  }
</script>

<style lang="stylus">
  .multipleUploadImg{
    .img-wrapper{
      .imgs-list{
        display: inline-block;
        min-height: 148px;
        margin: 0;
        padding: 0;
        list-style: none;
        li{
          border: 1px solid #c0ccda;
          border-radius: 6px;
          box-sizing: border-box;
          width: 148px;
          height: 148px;
          float: left;
          margin-right: 5px;
          position: relative;
          overflow: hidden;
          img{
            width: 148px;
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
          }
        }
      }
    }
  }
</style>
